home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / cftable.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.2 KB  |  42 lines

  1. <!--- This example shows the use of CFCOL and CFTABLE
  2. to align information returned from a query --->
  3.  
  4. <!--- this query selects employee information from the
  5. snippets datasource --->
  6. <CFQUERY NAME="GetEmployees" DATASOURCE="cfsnippets">
  7. SELECT      Emp_ID, FirstName, LastName, EMail, Phone, Department
  8. FROM         Employees
  9. </CFQUERY>
  10.  
  11. <HTML>
  12. <HEAD>
  13. <TITLE>CFTABLE Example</TITLE>
  14. </HEAD>
  15.  
  16. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  17. <BODY  bgcolor="#FFFFD5">
  18.  
  19. <H3>CFTABLE Example</H3>
  20. <!--- Note the use of the HTMLTABLE attribute to display the
  21. CFTABLE as an HTML table, rather simply as PRE formatted information --->
  22. <CFTABLE QUERY="GetEmployees" STARTROW="1" COLSPACING="3" HTMLTABLE COLHEADERS>
  23. <!--- each CFCOL tag sets the width of a column in the table,
  24. as well as specifying the header information and the text/CFML
  25. with which to fill the cell --->
  26.     <CFCOL HEADER = "<B>ID</B>"
  27.         ALIGN = "Left"
  28.         WIDTH = 2
  29.         TEXT  = "#Emp_ID#">
  30.     <CFCOL HEADER = "<B>Name/Email</B>"    
  31.         ALIGN = "Left"
  32.         WIDTH = 15
  33.         TEXT  = "<a href='mailto:#Email#'>#FirstName# #LastName#</A>">
  34.     <CFCOL HEADER = "<B>Phone Number</B>"
  35.         ALIGN = "Center"
  36.         WIDTH = 15
  37.         TEXT  = "#Phone#">
  38. </CFTABLE>
  39.  
  40. </BODY>
  41. </HTML>       
  42.